package com.ruoyi.background.service;

import com.ruoyi.background.domain.AppLotteryPrize;
import com.ruoyi.background.domain.AppWechatUser;
import org.springframework.scheduling.annotation.Async;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 积分抽奖奖品Service接口
 *
 * @author susu
 * @date 2024-08-24
 */
public interface IAppLotteryPrizeService {


    /**
     * 生成预抽奖结果
     *
     * @return 结果
     */
    public int createUserPreLottery();

    public int setNowWinNum();

    public int initUserIsFinale();


    /**
     * 查询积分抽奖奖品
     *
     * @param id 积分抽奖奖品主键
     * @return 积分抽奖奖品
     */
    public AppLotteryPrize selectAppLotteryPrizeById(Long id);

    /**
     * 查询积分抽奖奖品列表
     *
     * @param appLotteryPrize 积分抽奖奖品
     * @return 积分抽奖奖品集合
     */
    public List<AppLotteryPrize> selectAppLotteryPrizeList(AppLotteryPrize appLotteryPrize);

    /**
     * 去数量不为0的奖品
     *
     * @return 结果
     */
    public List<AppLotteryPrize> getPrizeNumNot0();

    /**
     * 新增积分抽奖奖品
     *
     * @param appLotteryPrize 积分抽奖奖品
     * @return 结果
     */
    public int insertAppLotteryPrize(AppLotteryPrize appLotteryPrize);

    /**
     * 修改积分抽奖奖品
     *
     * @param appLotteryPrize 积分抽奖奖品
     * @return 结果
     */
    public int updateAppLotteryPrize(AppLotteryPrize appLotteryPrize);

    /**
     * 修改状态
     *
     * @param id     id
     * @param status 状态
     * @return 结果
     */
    public int changeStatus(Long id, Integer status);

    /**
     * 批量删除积分抽奖奖品
     *
     * @param ids 需要删除的积分抽奖奖品主键集合
     * @return 结果
     */
    public int deleteAppLotteryPrizeByIds(Long[] ids);

    /**
     * 删除积分抽奖奖品信息
     *
     * @param id 积分抽奖奖品主键
     * @return 结果
     */
    public int deleteAppLotteryPrizeById(Long id);


    /**
     * 用户抽奖
     *
     * @return 中奖的奖品
     */
    public AppLotteryPrize lotteryPrize();


    @Async
    public void setLotteryData(AppLotteryPrize appLotteryPrize, AppWechatUser wechatUser, int grade, int lotteryIndex);
}
